return display->seats->data;
}
+static GdkMonitor *
+gdk_display_real_get_primary_monitor (GdkDisplay *display)
+{
+ return gdk_display_get_monitor (display, 0);
+}
+
static void
gdk_display_class_init (GdkDisplayClass *class)
{
class->event_data_free = gdk_display_real_event_data_free;
class->get_default_seat = gdk_display_real_get_default_seat;
+ class->get_primary_monitor = gdk_display_real_get_primary_monitor;
+
/**
* GdkDisplay::opened:
* @display: the object on which the signal is emitted
* manager to place the windows, specialized desktop applications
* such as panels should place themselves on the primary monitor.
*
- * Returns: (nullable) (transfer none): the primary monitor, or %NULL if no primary
- * monitor is configured by the user
+ * If no monitor is the designated primary monitor, any monitor
+ * (usually the first) may be returned. To make sure there is a dedicated
+ * primary monitor, use gdk_monitor_is_primary() on the returned monitor.
+ *
+ * Returns: (transfer none): the primary monitor, or any monitor if no
+ * primary monitor is configured by the user
+ *
* Since: 3.22
*/
GdkMonitor *
{
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
- if (GDK_DISPLAY_GET_CLASS (display)->get_primary_monitor)
- return GDK_DISPLAY_GET_CLASS (display)->get_primary_monitor (display);
-
- return NULL;
+ return GDK_DISPLAY_GET_CLASS (display)->get_primary_monitor (display);
}
/**